#!/usr/bin/env python

import re
from gradelib import *

r = Runner(save("xv6.out"))

@test(30, "alloctest")
def test_alloctest():
    r.run_qemu(shell_script([
        'alloctest'
    ]))
    r.match("^filetest: OK$")

@test(50, "alloctest")
def test_alloctest():
    r.run_qemu(shell_script([
        'alloctest'
    ]))
    r.match("^memtest: OK$")

@test(20, "usertests")
def test_usertests():
    r.run_qemu(shell_script([
        'usertests'
    ]), timeout=150)
    r.match('^ALL TESTS PASSED$')

run_tests()
